import request from '@/utils/request'
import type { CategoryList } from './model/categoryModel'
enum Api{
    getCategory1List = "/admin/product/getCategory1",
    getCategory2List = "/admin/product/getCategory2",
    getCategory3List = "/admin/product/getCategory3"
}

// 获取一级列表
export const getCategory1ListApi = ()=>{
    return request.get<any,CategoryList>(Api.getCategory1List)
}

// 获取二级列表
export const getCategory2ListApi = (category1Id:number)=>{
    return request.get<any,CategoryList>(`${Api.getCategory2List}/${category1Id}`)
}

// 获取三级级列表
export const getCategory3ListApi = (category2Id:number)=>{
    return request.get<any,CategoryList>(`${Api.getCategory3List}/${category2Id}`)
}